<?php
require_once 'Zend/Gdata/YouTube.php';

/**
 * Blg wrapper for youtube videos
 * @param Zend_Gdata_YouTube_VideoEntry 
 * @author Pablo
 * @since 1.0
 */
class BlgYoutube extends BlgData{
	protected $video_entry;
	
	function __construct($id){		
		$this->initializeAttributes();			
	
		$yt= new Zend_Gdata_YouTube(NULL, NULL, NULL, GDATA_DEVELOPER_KEY);		
		$this->video_entry= $yt->getVideoEntry($id);			
	}	
	
	/*
	protected function initializeAttributes(){
		parent::initializeAttributes();
	}
	*/
	
	/*** GETTERS ***/
	public function get_gdata_video_entry(){
		return $this->video_entry;
	}
	
	public function get_video_id($id){
		return $this->video_entry->getVideoId();
	}
	
	public function get_video_duration(){
		return $this->video_entry->getVideoDuration();
	}
	
	public function get_video_title(){
		return $this->video_entry->getVideoTitle();
	}
	
	public function get_video_description(){
		return $this->video_entry->getVideoDescription();
	}
	
	public function get_video_view_count(){
		return $this->video_entry->getStatistics()->getViewCount();
	}
	
	public function get_video_watch_count(){
		return $this->video_entry->getStatistics()->getVideoWatchCount();
	}
	
	public function get_watch_url(){
		return $this->video_entry->getVideoWatchPageUrl();
	}
	
	public function get_flash_url(){
		return $this->video_entry->getFlashPlayerUrl();
	}
	
	public function get_comments(){
		return $this->video_entry->getComments();
	}
	
	public function get_location(){
		return $this->video_entry->getLocation();
	}
	
	public function is_embeddable(){
		return $this->video_entry->isVideoEmbeddable();
	}
	
	public function get_rating_average(){
		return $this->video_entry->getRating()->getAverage();
	}
	
	public function get_num_raters(){
		return $this->video_entry->getRating()->getNumRaters();	
	}	
	
	public function get_rating_info(){
		return $this->video_entry->getVideoRatingInfo();		
	}
	
	public function get_video_tags(){
		return $this->video_entry->getVideoTags();
	}
	
	public function get_thumbnails(){
		return $this->video_entry->getVideoThumbnails();
	}
	
	public function is_private(){
		return $this->video_entry->isVideoPrivate();		
	}
	
	/*** PLAYERS ***/
	
	public function getPlayer($type=NULL){
		switch($type){
			
		}
	}
	
	/*** ABSTRACT METHODS ***/
	public function getURL(){
		return $this->get_watch_url();
	}
	
	public function save(){}
	public function delete(){}	
}